﻿using System;

namespace ShkSimulation.core.template.model {

	public class NetworkRunInfo {
		
		private NetworkRunInfo(Network network, Exception exception, string message) {
			this.Network = network;
			this.Message = message;
			this.Success = false;
			this.RunException = exception;
		}

		private NetworkRunInfo(Network network, string message) {
			this.Network = network;
			this.Message = message;
			this.Success = true;
		}

		public Exception RunException { get; set; }
		
		public Network Network { get; set; }
		
		public bool Success { get; set; }
		
		public string Message { get; set; }

		public static NetworkRunInfo CreateByException(Network network, Exception exception) {
			return new NetworkRunInfo(network, exception, exception.Message);
		}

		public static NetworkRunInfo CreateByMessage(Network network, string message) {
			return new NetworkRunInfo(network, message);
		}

	}

}